package com.senseu.pages;

import com.senseu.base.BasePage;
import com.senseu.utils.AllureLogUtil;
import io.appium.java_client.AppiumBy;
import io.appium.java_client.AppiumDriver;
import org.openqa.selenium.WebElement;

public class PermissionSettingPage extends BasePage {

    public PermissionSettingPage(AppiumDriver driver) {
        super(driver);
    }

    public GuidePage clickConfirm() {
        WebElement confirm = driver.findElement(AppiumBy.id("com.senseu.baby:id/btnConfirm"));
        tapHelper.tap(confirm);

        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            AllureLogUtil.attachTextLog("等待500ms再点击报错", "");
            AllureLogUtil.takeScreenshot(driver);
        }
        confirm = driver.findElement(AppiumBy.id("com.senseu.baby:id/btnConfirm"));
        tapHelper.tap(confirm);
        return new GuidePage(driver);
    }
}
